package Singleton;

public class Singleton {
	
	/*
	 * 创建Singleton的一个对象
	 * Create an object for Singleton
	 */
	private static Singleton singleInstance = new Singleton();
	
	/*
	 * 设置构造函数为private，使得类不会被实例化
	 * Set the constructor to private 
	 * so that the class is not instantiated
	 */
	private Singleton() {
		System.out.println("Singleton is created");
	}
	
	/*
	 * 获取唯一可用的对象
	 * Get unique objects available
	 */
	public static Singleton getSingle() {
		return singleInstance;
	}
	
	public void createMessage() {
		System.out.println(" Create message in Singleton");
	}
}